package com.haozi.ehub.admin.controller;

import com.haozi.ehub.core.enums.HttpEunm;
import com.haozi.ehub.core.util.ReturnDataUtils;
import com.haozi.ehub.entity.code.RSACode;
import com.haozi.ehub.entity.entities.ReturnData;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登陆控制器
 * @author ：terry
 * @date ：Created in 2020/6/12 15:30
 * @description：TODO
 * @version: 1.0
 */
@RestController
@RequestMapping(value = "/admin")
public class LoginController {

    @RequestMapping(value = "/check-login",method = RequestMethod.GET)
    public ResponseEntity<String> login(){
        return new ResponseEntity<>("login", HttpStatus.OK);
    }

    @RequestMapping(value = "/login-key",method = RequestMethod.GET)
    public ReturnData<String> key(){
        return ReturnDataUtils.returnDataSuccess(RSACode.PUBLIC_KEY, HttpEunm.GET_DATA_OK.getMsg());
    }
}
